#define apiDocLayout()
#@doApiDocLayout()
#end
#define doApiDocLayout()
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>到岗到位</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="/static/assets/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/static/assets/font-awesome/css/font-awesome.min.css">
	<!-- Theme style -->
	<link rel="stylesheet" href="/static/assets/lte/css/AdminLTE.min.css">
	<!-- AdminLTE Skins. Choose a skin from the css/skins
	 folder instead of downloading all of them to reduce the load. -->
	<link rel="stylesheet" href="/static/assets/lte/css/skins/_all-skins.min.css">
	<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="/static/assets/js/html5shiv.min.js"></script>
    <script src="/static/assets/js/respond.min.js"></script>
	<![endif]-->
    <!-- jQuery 3 -->  
	<script src="/static/assets/jquery/dist/jquery.min.js"></script>
	<script src="/static/layer/layer.js"></script>
	<script src="/static/basic/js/basic-toolbox.js" type="text/javascript" ></script>
</head>

<body class="hold-transition skin-blue sidebar-mini">

<div class="wrapper">
	 <header class="main-header">
	    <!-- Logo -->
	    <a href="#" class="logo">
	      <!-- mini logo for sidebar mini 50x50 pixels -->
	      <span class="logo-mini"><b>文</b>档</span>
	      <!-- logo for regular state and mobile devices -->
	      <span class="logo-lg"><b>到岗到位API文档</b></span>
	    </a>
	    <nav class="navbar navbar-static-top">
			      <!-- Sidebar toggle button-->
			      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
			        <span class="sr-only">切换导航</span>
			      </a>
			      <!-- Navbar Right Menu -->
				  <div class="navbar-custom-menu">
			        <ul class="nav navbar-nav">
			          <li>
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								<span>
									<small>操作选项</small>
								</span>
								<i class="fa fa-caret-down"></i>
							</a>
							<ul class="dropdown-menu">
								<li>
									<a href="javascript:getToken();">
										<i class="light-grey fa fa-user" style="width:15px;"></i>
										<span style="color:#999C9E">获取token</span>
									</a>
								</li>
								<li>
									<a href="javascript:clearToken();">
										<i class="light-grey fa fa-unlock" style="width:15px;"></i>
										<span style="color:#999C9E">清除token</span>
									</a>
								</li>
								<li class="divider"></li>
							</ul>
						</li>
			        </ul>
			       </div>
		</nav>
	  </header>
	  <!-- Left side column. contains the logo and sidebar -->
	  <aside class="main-sidebar">
		    <!-- sidebar: style can be found in sidebar.less -->
		    <section class="sidebar" style="">
		      <!-- Sidebar user panel -->
		      <div class="user-panel">
		        <div class="pull-left image">
		        </div>
		        <div class="pull-left info">
		        </div>
		      </div>
		      <!-- sidebar menu: : style can be found in sidebar.less -->
		      <ul id="sidebar_container" class="sidebar-menu" data-widget="tree">
		        <li class="header">功能菜单</li> 
		        <li>
		      </ul>
		    </section>
		    <!-- /.sidebar -->
	   </aside>
	  <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper" style="background-color:#fff;">
           <!-- Main content -->
    	   <section>
              <iframe data-type="tab_iframe" id="iframe" src="" width="100%" height="" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="yes" allowtransparency="yes" style="display:block;"></iframe>
    	   </section>
      </div>
</div>

<!-- Bootstrap 3.3.7 -->
<script src="/static/assets/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="/static/assets/lte/js/adminlte.min.js"></script>
<script>
     var apimenu = #(data);
     var apimodules = new StringBuffer();
     for(var module in apimenu){
    	   //模块
    	   getModule(module);
	       var contollers = apimenu[module];
	       for(var i=0;i<contollers.length;i++){
	    	   getController(contollers[i],module);
	    	   apimodules.append('</li>');
	    	   apimodules.append('</ul>');
	       }
	       apimodules.append('</li>');
	       $("#sidebar_container").html(apimodules.toString());
     }
     
     
     function getModule(module){
    	 if(module!=""){
    		 apimodules.append('<li class="treeview">');
        	 apimodules.append('<a href="#">');
        	 apimodules.append('<i class="fa fa-book"></i>');
        	 apimodules.append('<span>');  
        	 apimodules.append(module);  
        	 apimodules.append('</span>');
        	 apimodules.append('<span class="pull-right-container">');
        	 apimodules.append('<i class="fa fa-angle-left pull-right"></i>');  
        	 apimodules.append('</span>');     
        	 apimodules.append('</a>');       
        	
    	 }else{
    	 }
     }
     
     function getController(controller,moduleName){
    	 if(moduleName!=""){
    		 apimodules.append('<ul class="treeview-menu">');
    		 apimodules.append('<li class="treeview">');
        	 apimodules.append('<a href=""><i class="fa fa-file-text"></i>');
        	 apimodules.append('<span>');  
        	 apimodules.append(controller.title);
        	 apimodules.append('</span>');
        	 apimodules.append('<span class="pull-right-container">');
        	 apimodules.append('<i class="fa fa-angle-left pull-right"></i>');  
        	 apimodules.append('</span>');   
        	 apimodules.append('</a>');
    	 }
    	 var methods = controller.methodsModel;
    	 apimodules.append('<ul class="treeview-menu">');
   		 for(var i = 0 ; i<methods.length;i++){
   			 getMethods(controller,methods[i]);
   		 }
   		 apimodules.append('</ul>');
     }
     
     function getMethods(controller,method){
    	 var href = "/apiDoc/test/"+encodeURIComponent(controller.controllerKey)+"-"+encodeURIComponent(method.actionKey);
    	 apimodules.append('<li>');
    	 apimodules.append("<a href=\"#\" onclick=\"test('"+href+"')\"><i class=\"fa fa-circle-o\"></i>");
    	 apimodules.append(method.title);
    	 apimodules.append('</a>');
    	 apimodules.append('</li>');
     }
     
     function test(url){
    	 $('#iframe').attr("src",url);  
    	 $('#iframe').attr("height",$(window).height()-50); 
     }
     
	 var getToken = function(){
		layer.open({
     	    type: 2,
     	    title:"获取token",
     	    area: ["250", "320px"],
     	    fix: true, //不固定
     	    maxmin: false,
     	    content: "/apiDoc/token"
     	});
	 };
	 
	 var clearToken = function(){
		 localStorage.removeItem("token");
		 layer.msg("清除成功!", {icon: 1});
	 }
</script>
</body>
</html>
#end